{extend name="template/base" /}
{block name="content"}
<div class="page-container">

    <form class="mb-20" method="get" action="{:\\think\\Url::build($Request.action)}">
        <input type="text" class="input-text" style="width:250px" placeholder="专题名称" name="name" value="{$Request.param.name}">
        <button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    </form>

    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            {tp:menu menu="add" /}
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$total ?? 0}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>

        <tr class="text-c">
            <th width="5%">专题id</th>
            <th width="10%">专题名称</th>
            <th width="5%">排序值</th>
            <th width="15%">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            <td>{$vo.sid}</td>
            <td>{$vo.name}</td>
            <td>{$vo.ssort}</td>
            <td>
                <a class="label ml-5 radius label-danger" href="javascript:;" onclick="godel('{$vo.sid}',this)">删除</a>
                <a class="label ml-5 radius label-primary" href="javascript:;" onclick="layer_open('修改分类','__URL__/update/id/{$vo.sid}')">修改</a>
                <a class="label ml-5 radius label-success" href="javascript:;" onclick="layer_open('添加专题商品','__URL__/addgoods/id/{$vo.sid}')">添加商品</a>
            </td>
        </tr>
        {/volist}

        </tbody>
    </table>
    <div class="page-bootstrap">{$page??''}</div>
</div>
{/block}


{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>

    // 删除专题
    function godel(id,obj) {
        layer.confirm('确定要删除该专题吗？', {
            btn: ['确定', '取消'],
            title: '提示',
            icon: 3
        }, function () {
            url = "__URL__/del";
            $.post(url, {id: id}, function (data) {
                if (data.code == 0) {
                    layer.msg(data.msg, {icon: 1, time: 1000});
                    $(obj).parent().parent().remove();
                } else {
                    layer.alert(data.msg);
                }
            }, 'json')
        }, function (index) {
            layer.close(index);
        });

    }
</script>
{/block}

